🎨 Notes for Lecture 14: Introduction to CSS

What is CSS?

CSS (Cascading Style Sheets) is used to style and layout web pages. While HTML is used to define content structure, CSS controls how that content appears.

Common Selectors Used

  • div – Block container for grouping content
  • span – Inline container for styling inline content
  • p – Paragraph text content

Applied Styles in This Lecture

div {
    color: blueviolet;
    background-color: lightcoral !important;
    padding: 20px;
}

span {
    color: bisque;
    background-color: darkblue;
    display: flex;
    justify-content: center;
}

p {
    color: aliceblue;
    background-color: darkgoldenrod;
    text-align: center;
}

Explanation of Properties

  • color: Sets the text color
  • background-color: Sets the background color
  • padding: Adds spacing inside the element
  • display: flex: Enables flexbox layout
  • justify-content: center: Centers child elements horizontally (when using flexbox)
  • text-align: center: Centers the text horizontally
  • !important: Forces a style to override others

Why Use CSS?

  • To separate content (HTML) from presentation (CSS)
  • To enable consistent design across multiple pages
  • To allow easy theming, updates, and responsive designs

Useful Resources

Hinglish: Lecture 14 mein humne basic CSS sikha. Pehle humne HTML structure banaya jisme <div>, <span>, aur <p> tags use kiye. Fir CSS file mein un elements ko style diya jaise color, background-color, padding, text-align, aur display: flex. !important ka use style ko forcefully apply karne ke liye kiya gaya. Har selector ka color aur layout change hua CSS ke through. Ye lecture styling ka foundation set karta hai jisme humne styling ko HTML se separate karke alag CSS file mein likhna seekha.

πŸ’» Live Code Preview

If the iframe doesn’t load, click
here to open Lecture 14 Demo in a new tab.

← Back to Lecture Dashboard